forum

Home / DeveloperSection / Forums / Dropdownlist DataValueField in asp.net c#

Dropdownlist DataValueField in asp.net c#

Anonymous User 2592 06-Jan-2015

I have multiple items in asp drop down list and I want to set its DataValueField to one by one using loop. I did it as follow.

int cnt = ddl2.Items.Count;
 
for(int j=0;j<cnt;j++)
{
    string val = ddl2.Items[j].ToString();
    int datafieldid = // want datavaluefield id here
}

Please help.

Thanks.

 


Updated on 06-Jan-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By